/**
 * @file   callbacks.h
 * @author Pedro
 * @date   Thu Nov  6 12:25:20 2008
 * 
 * @brief  Definición de las funciones de manejo de eventos (callbacks del entorno gráficos) y otros eventos
 * 
 * 
 */

#ifndef _CALLBACKS_H_
#define _CALLBACKS_H_

#include <gtk/gtk.h>

#include "dc_captura.h"
#include "socket.h"
#include "serial.h"

/**
 * Funciones de callback
 * 
 */


void
on_salir_activate                      (GtkObject       *object,
                                        gpointer         user_data);

gboolean
on_drawingarea1_configure_event        (GtkWidget       *widget,
                                        GdkEventConfigure *event,
                                        gpointer         user_data);

gboolean
on_drawingarea1_expose_event           (GtkWidget       *widget,
                                        GdkEventExpose  *event,
                                        gpointer         user_data);

gboolean
on_imagen_pressed                      (GtkWidget       *widget,
                                        GdkEventButton  *event,
                                        gpointer         user_data);

gboolean
on_drawingarea2_configure_event        (GtkWidget       *widget,
                                        GdkEventConfigure *event,
                                        gpointer         user_data);

gboolean
on_drawingarea2_expose_event           (GtkWidget       *widget,
                                        GdkEventExpose  *event,
                                        gpointer         user_data);

void
on_cofiguraci__n1_activate             (GtkMenuItem     *menuitem,
                                        gpointer         user_data);

void
on_nombre_para_las_capturas1_activate  (GtkMenuItem     *menuitem,
                                        gpointer         user_data);

void
on_formato_imagen1_activate            (GtkMenuItem     *menuitem,
                                        gpointer         user_data);

void
on_bmp1_activate                       (GtkMenuItem     *menuitem,
                                        gpointer         user_data);

void
on_raw1_activate                       (GtkMenuItem     *menuitem,
                                        gpointer         user_data);

void
on_jpeg1_activate                      (GtkMenuItem     *menuitem,
                                        gpointer         user_data);

void
on_reproducir_clicked                  (GtkButton       *button,
                                        gpointer         user_data);

void
on_grabar_clicked                      (GtkButton       *button,
                                        gpointer         user_data);
void
on_exit_clicked                        (GtkButton       *button,
                                        gpointer         user_data);

void
on_stop_clicked                        (GtkButton       *button,
                                        gpointer         user_data);

void
on_save_accept_clicked                 (GtkButton       *button,
                                        gpointer         user_data);

void
on_save_cancel_clicked                 (GtkButton       *button,
                                        gpointer         user_data);

void
on_reproduce_accept_clicked            (GtkButton       *button,
                                        gpointer         user_data);

void
on_reproduce_cancel_clicked            (GtkButton       *button,
                                        gpointer         user_data);

void
on_captura_clicked                     (GtkButton       *button,
                                        gpointer         user_data);

void
on_hscale_gain                         (GtkRange        *range,
                                        gpointer         user_data);

void
on_hscale_brightness                   (GtkRange        *range,
                                        gpointer         user_data);

void
on_hscale_shutter                      (GtkRange        *range,
                                        gpointer         user_data);

void
on_hscale_light_intensity              (GtkRange        *range,
                                        gpointer         user_data);

void
on_notebook_cabintec_switch_page       (GtkNotebook     *notebook,
                                        GtkNotebookPage *page,
                                        guint            page_num,
                                        gpointer         user_data);

void
on_checkbutton_sync_camera_activate    (GtkButton       *button,
                                        gpointer         user_data);

void
on_checkbutton_sync_external_activate  (GtkButton       *button,
                                        gpointer         user_data);

void
on_checkbutton_sim_sync    (GtkButton       *button,
			    gpointer         user_data);

// Reserva memoria para las ventanas donde se muestran las capturas. 
gboolean f_init (gpointer);
void tx_dato_intensidad (int);

bool datos_recibido(int datorx, unsigned char datotx, float time_lapso, 
		    serial_params_t *p, void *params);
bool socket_callback(socket_params_t * socket_params, void*params);


#endif
